def anagrams_sort(s1, s2):
    alist1 = list(s1)
    alist2 = list(s2)
    alist1.sort()
    alist2.sort()
    pos = 0
    matches = True
    while pos < len(s1) and matches:
        if alist1[pos] == alist2[pos]:
            pos += 1
        else:
            matches = False
    return matches


print(anagrams_sort('abcde', 'abcde'))


def anagrams_sort_self(s1, s2):
    alist1 = list(s1)
    alist2 = list(s2)
    alist1.sort()
    alist2.sort()
    if alist1 == alist2:
        matches = True
    else:
        matches = False
    return matches


print(anagrams_sort_self('李四', '张三'))
